package com.asset.dispoal.dic.service;

import com.asset.dispoal.dic.api.GbDicService;
import com.asset.dispoal.dic.dto.GbDicRequest;
import com.asset.dispoal.dic.service.commom.GbDicDeleteCommand;
import com.asset.dispoal.dic.service.commom.GbDicInsertCommand;
import com.asset.dispoal.dic.service.commom.GbDicQueryPageCommand;
import com.asset.dispoal.dic.service.commom.GbDicUpdateCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;


/**
 * @author qr
 * @date 2022/2/16$
 */
@Service
public class GbDicServiceImpl implements GbDicService {

    @Autowired
    GbDicDeleteCommand dicDeleteCommand;

    @Autowired
    GbDicInsertCommand gbDicInsertCommand;

    @Autowired
    GbDicUpdateCommand gbDicUpdateCommand;

    @Autowired
    GbDicQueryPageCommand dicQueryPageCommand;

    @Override
    public void insert(GbDicRequest request) {
        gbDicInsertCommand.execute(request);
    }

    @Override
    public void delete(String id) {
        dicDeleteCommand.execute(id);
    }

    @Override
    public void update(GbDicRequest request) {
        gbDicUpdateCommand.execute(request);
    }

    @Override
    public Result<PageVO> queryPage(GbDicRequest request) {
        return dicQueryPageCommand.execute(request);
    }
}
